﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Lilium.Web.Mvc.EntityFilters
{
	[Obsolete("Route values вполне достаточно для этих целей")]
	public class ActionReference
	{
		public ActionReference(ActionDescriptor actionDescriptor, params KeyValuePair<string, object>[] actionParameters)
			: this(actionDescriptor, (IEnumerable<KeyValuePair<string, object>>)actionParameters)
		{
		}

		public ActionReference(ActionDescriptor actionDescriptor, IEnumerable<KeyValuePair<string, object>> actionParameters)
		{
			if (actionDescriptor == null) throw new ArgumentNullException("actionDescriptor");
			if (actionParameters == null) throw new ArgumentNullException("actionParameters");

			m_ActionDescriptor = actionDescriptor;
			m_ActionParameters = actionParameters.ToDictionary(p => p.Key, p => p.Value);
		}

		#region public ActionDescriptor ActionDescriptor

		private readonly ActionDescriptor m_ActionDescriptor;

		public ActionDescriptor ActionDescriptor
		{
			get
			{
				return m_ActionDescriptor;
			}
		}

		#endregion

		#region public IDictionary<string, object> ActionParameters

		private readonly IDictionary<string, object> m_ActionParameters;

		public IDictionary<string, object> ActionParameters
		{
			get
			{
				return m_ActionParameters;
			}
		}

		#endregion
	}
}
